package com.example.mq.factory;

import com.example.mq.config.SysMQConfig;
import com.example.mq.dto.MQListenerDto;
import com.example.server.service.SysServerService;
import org.springframework.context.ApplicationContext;

import java.util.Map;

/*
 * @className: SysMQFactory
 * @author: chentao
 * @date: 2025/3/25 下午2:21
 * @Version: 1.0
 * @description:
 */
public interface SysMQFactory {

    public void init(SysMQConfig sysMQConfig, ApplicationContext applicationContext, SysServerService sysServerService);

    public void preValidate(Map<String, MQListenerDto> mqListenerDtoMap) throws Exception;

    public void start(Map<String, MQListenerDto> mqListenerDtoMap);

    public void stop() throws Exception;

    public void publish(String exchange, String routingKey, String content) throws Exception;

    public void publish(String queue, boolean isTopic, String content) throws Exception;
}
